import React, { Component } from 'react';
import CustomBreadcrumb from '../../components/CustomBreadcrumb';
import AddUserForm from './components/AddUserForm';
import { hashHistory } from 'react-router';

export default class AddUser extends Component {
  static displayName = 'AddUser';

  constructor(props) {
    super(props);
    this.state = {};
  }

    onSubmit = async(data) =>{
    console.log(data)
    setTimeout(() => { hashHistory.push('/user/list') }, 200);
    return true
  }

  render() {
    const breadcrumb = [
      { text: '用户管理', link: '#/user/list' },
      { text: '新增用户', link: '#/user/add' },
    ];
    return (
      <div className="adduser-page">
        <CustomBreadcrumb dataSource={breadcrumb} />
        <AddUserForm onSubmit={this.onSubmit}/>
      </div>
    );
  }
}
